lib/commit: Rework a conditional set for clarity and Coverity
authorColin Walters <walters@verbum.org>
Mon, 31 Jul 2017 16:35:58 +0000 (12:35 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 2 Aug 2017 15:34:16 +0000 (15:34 +0000)
commit2f0707a054139174bef552adc778259f58b12125
tree7450ec00c210b6ef5df281344c4446f3831c7435
parentfe8938227e767ab85bc4f1d599032165aa2bf133
lib/commit: Rework a conditional set for clarity and Coverity

Coverity complained that the `else if (bytes_read == 0)` was dead
code if we happened to find it was already false when testing
`else if (G_UNLIKELY (bytes_read == 0 ...`.

There was nothing wrong with the logic, but let's rework it to
only test the value once; I think it does end up nicer anyways.

Coverity CID: 1452186

Closes: #1037
Approved by: jlebon
src/libostree/ostree-repo-commit.c